import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { BaseEntity } from '../../entities/base.entity';
import { PageOptionsDto } from '../page.dto';
import { CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { Menu } from '../../entities/menu.entity';

import { Exclude, Type } from 'class-transformer';
import { IsInt, Min } from 'class-validator';
export class MenuWithChildrenDto extends Menu {
  children?: Menu[];
}

export class PageMenuDto extends Menu {
  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 10,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageSize: number = 10;

  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 1,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageNo: number = 1;
}

export class DeleteMenuDto {
  @IsNotEmpty()
  id: string;
}
